‫In this year, we are going to use our API to query our database with past parameters.
‫So we are going to be passing a parameter here in this parameter, of course, is going to be coming
‫from other application that is consuming this API.
‫So this parameter may be coming from your mobile app.
‫This may be coming from you are front end application, but we will react or whatever technology you
‫are using, you receive that parameter here.
‫It can be even more than one parameter.
‫And then you query, you run, you are you are you a database using that parameter?
‫And therefore, let's assume that you want to query the items, all the items we maybe the item group
‫is obviously.
‫So I'm doing this for the purpose of this demo only.
‫So what do you do in your API is you just apply.
‫Remember, this is this is this is Mănescu elsewhere.
‫I do it in group EQUASS and then you put this and you have Cybex.
‫I just hope I got it in group.
‫Right.
‫It's going to tell us if it is wrong.
‫So I have just added from that we are idam group equal services.
‫Let us send this is not supposed to have any chance now because this idea is a service so sent and a
‫business telling us that of course, no, it has given us the other status quo to fund it.
‫And they see the item you're looking for is not formulators you would have supplied here.
‫And yes, because I have written services.
‫So this is not going to be found so easy are the ACA services.
‫And now when I send this, you see that we are getting our status out of 200 and the body of our item.
‫And like like you have seen our what we did here to change the status code in the previous letter was
‫so we misspelled the services here.
‫We misspelled their services here.
‫Let me see where they can bring this sort of is more readable.
‫So select.
‫Said do somebody.
‫Let me get this up, back up so you confirm it is working years.
‫So this one is a bit reasonable.
‫So now we have a select name, item and description from table items.
‫We are item group equals services.
‫So if we add something here, like, okay, so this doesn't exist.
‫So there's no item group with this in the database.
‫And we send we see that the status is changing.
‫So the status quo is going to 400 and the body is the item you are looking for is not found.
‫Right.
‫So when we get this back now we get our items and note that the message here is going to change.
‫So an incentive is this is a message.
‫There's a status quo out of 200 and there is this one.
‫All right.
‫Perfect.
‫Now, the next thing I would like us to do, not not you are not going to be hard coding these services
‫here.
‫This obviously is going to be received probably from another application out there.
‫So what do you want to do again, to pass it here as a parameter?
‫And for now, I can just I can I can I can do maybe let me hardcoded fast Appia so I can see, think,
‫underscore group and then I see our group.
‫Let me just the group because then I see services and then I pick this group and instead of doing this
‫now I'm going to do that and we're the best group there.
‫And since no you are, you are using a variable inside of this query you are going to supply our formatted
‫stream.
‫So you put an IV at the front of this query and you realize that this one has changed.
‫The color of this thing has changed.
‫You see, it was this color before when you apply and if it is changing because this is a formatted
‫string.
‫So don't forget that.
‫So when you said this is supposed to work us where you are and now let's assume that we want to get
‫this from our front end application, so we need to remove this and now we can take this and pass it
‫as a parameter here.
‫And then what you're going to do is we are going to be receiving this from our API, from our front
‫end application, and therefore we come to postwoman.
‫And we are going to be doing here just for the purpose of this test is we are going to supply our form,
‫data is going to be group, and then here we pass, obviously.
‫So when we send this, we are supposed to get the same result.
‫And I think it's supposed to change.
‫And yes, you're getting the same result.
‫If we pass on if at the end of this we're going to get to the item is not found because there's no service
‫with this, with this, with the name of the service F.
‫Right.
‫So that's not found.
‫And when we pass that correctly, we get our item back.
‫So what we have done here, just to recap, is we have passed the parameter to our function and then
‫we have used that parameter to query our database and return.
‫Additionally, of course, doing are making all these checks and then returning a response and then
‫on our front end, of course, this is not going to be passed from the front end application.
‫We have the key of group which is expected on the API here.
‫And then we have our the the value, which is Tavis's.
‫Right.
‫So now how this is going to work is when you want to query, for instance, is are such you are doing
‫on your application.
‫When you want to search all the items which are services, you're going to supply a group of services
‫if you want to submit to to query all the items, which may be something else like this.
‫Jack GRB next here quickly and see what they have.
‫So item by item list.
‫So if I am to add another item here, maybe the code, of course.
‫And this is because the programmers cause.
‫Programmers, OK, programmers, cause why is this writing programmers?
‫Oh, this is from Gramma's p r o g r programmers cause and then the item group.
‫Yeah this one really let us change it to something like product.
‫OK, and then they give the unit of measurement.
‫So you see the notice one of the item group is products.
‫So send it in.
‫Now here you have two items.
‫We are one has an item group of products and they are as item group of services.
‫So if from your API send this again, you see this one as returned one result.
‫And this is because our item here is only getting our API is only getting items where the item group
‫is, is whatever we are passing from our API here.
‫In this case, it's obviously so if we didn't use two products, I hope I'm getting that right.
‫Check this and see that it is going to change.
‫Send it.
‫And yes, this one I think to our cost in the program, of course, in all this.
‫So that is how you do it and see you in the next next year.